<%--
  Created by IntelliJ IDEA.
  User: 钮孟义
  Date: 2020/11/3
  Time: 15:24
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<script src="/media/js/jquery-3.3.1.js"></script>
<html>
<head>
    <title>Title</title>
</head>
<body>
<script>
    function update() {
        $.ajax({
            url:'/updateAsk',
            type:'post',
            data:{id:$("#id").val(),name:$("#name").val(),startTime:$("#startTime").val(),endTime:$("#endTime").val(),reason:$("#reason").val(),},
            datatype: 'json',
            success:function (data) {
                if(data.code==1){
                    window.location.href = "askList.html?time="+Math.random();
                }
            }
        })
    }
</script>
<form>
    id:<input type="text" name="id" id="id" value="${ask.id}"><br>
    name:<input type="text" name="name" id="name" value="${ask.name}"><br>
    startTime:<input type="text" name="startTime" id="startTime" value="${ask.startTime}"><br>
    endTime:<input type="text" name="endTime" id="endTime" value="${ask.endTime}"><br>
    reason:<input type="text" name="reason" id="reason" value="${ask.reason}"><br>
    <button type="button" onclick="update()">更新</button>
</form>
</body>
</html>
